0)
{
ShowCourseDetail($courseID);
UpcomingDates($courseID);
}
//=========================================================================================================================================================================
function ShowCourseDetail($courseID)
{
global $lblSeminarTitle;
global $lblSeminarDescription;
global $lblPrice;
$sql = "SELECT courseName, description, price FROM Course WHERE courseID = $courseID";
$stmt = $_SESSION['DBH']->prepare($sql);
$stmt->execute();
if ($row = $stmt->fetch_assoc())
{
$lblSeminarTitle = $row["courseName"];
$description = html_entity_decode($row["description"]);
$lblSeminarDescription = str_replace("\\r\\n", " ", $description); // for spaw I guess
$lblPrice = GetPrices($row["price"]);
}
} // ShowCourseDetail()
//=========================================================================================================================================================================
function GetPrices($price)
{
$retval = ""; $multiRegDiscountPct = ""; $earlyBirdDiscountPct = "";
$sb = "
";
if ($price == "0.00")
$price = "(TBA)";
$sb .= "Course Price: $" . $price . " ";
// get business definitions
$earlyBirdDiscountPct = EARLYBIRDDISCOUNT*100;
$multiRegDiscountPct = MULTIREGDISCOUNT*100;
$sb .= "" . $earlyBirdDiscountPct . "% discount for early registration, ";
$sb .= $multiRegDiscountPct . "% discount for multiple registrants from the same company.";
$sb .= "
\n";
return $sb;
} // GetPrices()
//=========================================================================================================================================================================
function UpcomingDates($courseID)
{
global $lblUpcomingDates;
$firstRow = true;
$sb = "";
$sql = "SELECT cs.courseScheduleID,LEFT(c.courseName,60) AS courseName,DATE_FORMAT(cs.startDate,'%M|%e|%Y') AS startDate,DATE_FORMAT(cs.endDate,'%M|%e|%Y') AS endDate, LEFT(cs.location,35) AS location FROM Course c, CourseSchedule cs WHERE cs.active = 1 AND cs.courseID = c.courseID AND c.courseID = $courseID AND UNIX_TIMESTAMP(cs.startDate) > UNIX_TIMESTAMP(CURDATE()) - 172800 ORDER BY cs.startDate";
$stmt = $_SESSION['DBH']->prepare($sql);
$stmt->execute();
while ($row = $stmt->fetch_assoc())
{
if ($firstRow)
{
$sb .= "
";
}
if (strlen($sb) > 0)
$lblUpcomingDates = $sb;
else
$lblUpcomingDates = "None Scheduled: If you're interested in scheduling an on-site class for your own spa team, contact us at " . CUSTSERV_PHONE . ".";
} // UpcomingDates()
//=========================================================================================================================================================================
?>
Seminar Detail - Wynne Business